Fast connectionless communication for UTCP
The UDP provider enables UTCP to communicate with services over UDP (User Datagram Protocol), providing fast, connectionless communication with minimal overhead. This provider is ideal for applications requiring low latency, real-time data transmission, or fire-and-forget messaging.
UDP providers are configured using the following JSON structure:
{ "name": "udp_service", "provider_type": "udp", "host": "api.example.com", "port": 5000, "timeout": 5000, "max_retries": 3, "encoding": "utf-8" }
Field | Required | Description |
---|---|---|
name |
Yes | Unique identifier for the provider |
provider_type |
Yes | Must be set to "udp" |
host |
Yes | Hostname or IP address of the UDP server |
port |
Yes | Port number of the UDP server |
timeout |
No | Response timeout in milliseconds (default: 5000 ) |
max_retries |
No | Maximum number of retry attempts (default: 3 ) |
encoding |
No | Text encoding for string data (default: "utf-8" ) |
buffer_size |
No | Buffer size for receiving data (default: 1024 ) |
UDP is a connectionless protocol with specific characteristics that affect how tools are implemented:
Since UDP is connectionless and doesn't support standardized discovery, UTCP tools using UDP providers typically rely on:
/utcp
{ "name": "udp_service", "provider_type": "udp", "host": "api.example.com", "port": 5000, "discovery_url": "https://api.example.com/utcp" }
{ "name": "dns_service", "provider_type": "udp", "host": "dns.example.com", "port": 53, "timeout": 3000, "max_retries": 2 }
{ "name": "game_server", "provider_type": "udp", "host": "game.example.com", "port": 7777, "timeout": 1000, "max_retries": 1, "buffer_size": 2048 }
{ "name": "sensor_data", "provider_type": "udp", "host": "sensors.example.com", "port": 1234, "timeout": 2000, "max_retries": 0, "encoding": "binary" }
© 2024 Universal Tool Calling Protocol. All rights reserved.